package com.boot2.core.feign;

import feign.RequestInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

 /**
 * @author zhangweilin
 * @date 2019/5/29 22:57
 * @Description:Feign配置注册（全局）
 */
@Configuration
@ConditionalOnClass(name = "org.springframework.cloud.netflix.feign.FeignClient")
public class FeignSupportConfig {
  /**
   * feign请求拦截器
   *
   * @return
   */
  @Bean
  public RequestInterceptor requestInterceptor(){
    return new FeignBasicAuthRequestInterceptor();
  }
}